package com.glacier.yuyuan.gen.core.domain;

import java.io.Serializable;

/**
 * date 2023-01-30 19:33
 *
 * @author glacier
 * @version 1.0.0
 */
public class ColumnInfo implements Serializable {

    private static final long serialVersionUID = 8257348922894567096L;
    /**
     * 在数据库中的列名
     */
    private String name;

    /**
     * 数据库中的类型
     */
    private String dbType;
    /**
     * java属性名
     */
    private String fieldName;
    /**
     * java类型
     */
    private String javaType;
    /**
     * 注释
     */
    private String comment;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public String toString() {
        return "ColumnInfo{" +
                "name='" + name + '\'' +
                ", dbType='" + dbType + '\'' +
                ", fieldName='" + fieldName + '\'' +
                ", javaType='" + javaType + '\'' +
                ", comment='" + comment + '\'' +
                '}';
    }


    public static final class ColumnInfoBuilder {
        private String name;
        private String dbType;
        private String fieldName;
        private String javaType;
        private String comment;

        private ColumnInfoBuilder() {
        }

        public static ColumnInfoBuilder aColumnInfo() {
            return new ColumnInfoBuilder();
        }

        public ColumnInfoBuilder name(String name) {
            this.name = name;
            return this;
        }

        public ColumnInfoBuilder dbType(String dbType) {
            this.dbType = dbType;
            return this;
        }

        public ColumnInfoBuilder fieldName(String fieldName) {
            this.fieldName = fieldName;
            return this;
        }

        public ColumnInfoBuilder javaType(String javaType) {
            this.javaType = javaType;
            return this;
        }

        public ColumnInfoBuilder comment(String comment) {
            this.comment = comment;
            return this;
        }

        public ColumnInfo build() {
            ColumnInfo columnInfo = new ColumnInfo();
            columnInfo.setName(name);
            columnInfo.setDbType(dbType);
            columnInfo.setFieldName(fieldName);
            columnInfo.setJavaType(javaType);
            columnInfo.setComment(comment);
            return columnInfo;
        }
    }
}
